<?php
/**
 * Created by PhpStorm.
 * User: ljc
 * Date: 2018/7/18
 * Time: 13:55
 */
use Modules\Admin\Entities\Module;
class ModuleService{
	//更新模块，将模块数据删除
	public function update(){
		\DB::table ('modules')->truncate ();
		$module=\HDModule::getModulesLists();
		return $module;
	}
	public function is_homeaccess($module){
		$controller="Modules\\".$module['name']."\Http\\Controllers\HomeController";
		$res=class_exists ($controller)&&method_exists ($controller,'index');
		return $res;
	}
	public function getdefault(){
		$module=Module::where('is_default','=','1')->first();
		return $module;
	}
}